package SolrApps;

import UntilSolr.UntilSolrCloud;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.CloudSolrServer;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class DeleteData {
    public static void main(String[] args){
        CloudSolrServer cloudSolrServer = UntilSolrCloud.getCollection();
        List<String> ids = new ArrayList<String>();
        ids.add("row998");
        ids.add("row999");
        try {
            cloudSolrServer.deleteById(ids);
            cloudSolrServer.commit();
            System.out.println("删除成功！");

        } catch (SolrServerException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
